package BC98_序列中删除指定数字;

import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i++){
            list.add(sc.nextInt());
        }
        int del = sc.nextInt();
        ArrayList<Integer> delList = new ArrayList<>();
        for (int i = 0; i < list.size(); i++){
            if (list.get(i) != del){
                delList.add(list.get(i));
            }
        }

        for (Integer e : delList){
            System.out.printf(e + " ");
        }

    }
}
